/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ventanas;

import bbdd.mysql.ConexionMysql;
import bbdd.sqlite.ConexionSqlLite;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;


public class VentanaSecundaria {
    Stage stage;

    public VentanaSecundaria() {
        stage = new Stage();
    }
    public void show(ConexionSqlLite connSqlite,ConexionMysql connMysql){
        try {
            URL location = getClass().getResource("VentanaSecundariaFXML.fxml");
            FXMLLoader fxmlLoader = new FXMLLoader(location,null);
            AnchorPane rootPane = (AnchorPane) fxmlLoader.load();
            VentanaSecundariaFXMLController ctr = (VentanaSecundariaFXMLController) fxmlLoader.getController();
            ctr.setConexiones(connSqlite, connMysql);
            
            Scene myDialogScene = new Scene(rootPane, 900,400);
            stage.initModality(Modality.APPLICATION_MODAL);
            stage.setTitle("Copiar Datos");
            stage.setScene(myDialogScene);
            stage.centerOnScreen();
            stage.showAndWait();
        } catch (IOException ex) {
            Logger.getLogger(VentanaSecundaria.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public void destroy(){
        stage.close();
    }
}
